package com.amorcloud.pig.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.amorcloud.pig.bean.CheckBean;
import com.amorcloud.pig.bean.PigInfoBean;
import com.amorcloud.pig.bean.UserInfoBean;

import com.amorcloud.pig.greendao.CheckBeanDao;
import com.amorcloud.pig.greendao.PigInfoBeanDao;
import com.amorcloud.pig.greendao.UserInfoBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig checkBeanDaoConfig;
    private final DaoConfig pigInfoBeanDaoConfig;
    private final DaoConfig userInfoBeanDaoConfig;

    private final CheckBeanDao checkBeanDao;
    private final PigInfoBeanDao pigInfoBeanDao;
    private final UserInfoBeanDao userInfoBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        checkBeanDaoConfig = daoConfigMap.get(CheckBeanDao.class).clone();
        checkBeanDaoConfig.initIdentityScope(type);

        pigInfoBeanDaoConfig = daoConfigMap.get(PigInfoBeanDao.class).clone();
        pigInfoBeanDaoConfig.initIdentityScope(type);

        userInfoBeanDaoConfig = daoConfigMap.get(UserInfoBeanDao.class).clone();
        userInfoBeanDaoConfig.initIdentityScope(type);

        checkBeanDao = new CheckBeanDao(checkBeanDaoConfig, this);
        pigInfoBeanDao = new PigInfoBeanDao(pigInfoBeanDaoConfig, this);
        userInfoBeanDao = new UserInfoBeanDao(userInfoBeanDaoConfig, this);

        registerDao(CheckBean.class, checkBeanDao);
        registerDao(PigInfoBean.class, pigInfoBeanDao);
        registerDao(UserInfoBean.class, userInfoBeanDao);
    }
    
    public void clear() {
        checkBeanDaoConfig.clearIdentityScope();
        pigInfoBeanDaoConfig.clearIdentityScope();
        userInfoBeanDaoConfig.clearIdentityScope();
    }

    public CheckBeanDao getCheckBeanDao() {
        return checkBeanDao;
    }

    public PigInfoBeanDao getPigInfoBeanDao() {
        return pigInfoBeanDao;
    }

    public UserInfoBeanDao getUserInfoBeanDao() {
        return userInfoBeanDao;
    }

}
